﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AddRules.aspx.cs" Inherits="Ebiz.AddRules" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        var form1 = "<%= Form1.ClientID %>";
    </script>
    <script src="js/AddRule.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="server">
    <h3>Create New Approval Rule / Add Scenario</h3>
    <form id="Form1" runat="server">
        <div id="divRules" style="margin:5px 120px;">
            <div id="ruleInfo">
                <table id="tblAddRule" style="margin-left:42px;">
                    <tr>
                        <td>Rule Control <span style="color:Red;">*</span></td><td>:</td>
                        <td>
                            <select name="cbAddRules" id="cbAddRules">
                                <option value="0">--- Select ---</option>
                            </select>
                        </td>
                        <td style="text-align:right;">
                            <div class="btnHelp fl_right" title="Help" 
                                style="cursor:pointer;font-weight:bold;font-size:14px;margin:0;padding:4px 5px; color: #3399FF; font-family: Arial, Helvetica, sans-serif;">HELP</div>
                            <img class="btnHelp fl_right" src="images/help-big.png" style="border:0;cursor:pointer;height:24px;width:24px;" alt="Help" title="Help" />
                            <div class="cl_right"></div>
                        </td>
                    </tr>
                    <tr><td colspan="4">&nbsp;</td></tr>
                    <tr>
                        <td valign="top" style="padding-top:4px;">Conditions <span style="color:Red;">*</span></td>
                        <td valign="top" style="padding-top:4px;">:</td>
                        <td colspan="2">
                            <div id="divCondition"></div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style="padding-top:6px;">&nbsp;</td>
                        <td colspan="2">
                            <input type="checkbox" name="txtOverDisc" id="txtOverDisc" value="1" style="display:inline;" />Override Discount
                            <img id="imgInfo3" src="images/helpx.png" title="What's this?" alt="What's this?" style="display:inline; margin-left:5px; border:0; height:16px; width:16px; cursor:pointer" />
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-top:6px;">Rule Category<input type="hidden" name="txtCategory" id="txtCategory" value="" /></td><td>:</td>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="padding-top:6px;">Total Rules in Category</td><td>:</td>
                        <td colspan="2">&nbsp;</td>
                    </tr>
                    <tr>
                        <td style="padding-top:6px;">Approval Layer Key <span style="color:Red;">*</span></td><td>:</td>
                        <td colspan="2"><input name="txtAppKey" id="txtAppKey" value="2" style="width:42px;text-align:right;font-size:12px;" />
                            <img id="imgInfo1" src="images/helpx.png" title="What's this?" alt="What's this?" style="display:inline; margin-left:5px; border:0; height:16px; width:16px; cursor:pointer" />
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-top:6px;">Total Approval Layers (Max) <span style="color:Red;">*</span></td><td>:</td>
                        <td colspan="2"><input name="txtLayers" id="txtLayers" value="5" style="width:42px;text-align:right;font-size:12px;" title="This can be changed in layer editor" />
                            <img id="imgInfo2" src="images/helpx.png" title="What's this?" alt="What's this?" style="display:inline; margin-left:5px; border:0; height:16px; width:16px; cursor:pointer" />
                        </td>
                    </tr>
                    <tr>
                        <td valign="top" style="padding-top:6px;">Rule Descriptions</td><td valign="top" style="padding-top:6px;">:</td>
                        <td colspan="2" style="padding-top:6px;">
                            <input type="hidden" name="txtFixDisc" id="txtFixDisc" value="0" />
                            <textarea name="txtDescription" id="txtDescription" rows="3" cols="35"></textarea>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="padding-top:6px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="2">&nbsp;</td>
                        <td colspan="2" style="padding-top:6px;">
                            <div id="btnSave" class="btnSmall" title="Create Rule">Create Rule</div>
                            <div id="btnCancel" class="btnSmall" title="Cancel" style="margin-left:10px;">Cancel</div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="4" style="padding-top:6px;">&nbsp;</td>
                    </tr>
                    <tr>
                        <td colspan="4" style="color: Red">*) Required fields</td>
                    </tr>
                </table>
            </div>
        </div>
        <div id="divLayerEditor" style="display:none;">
            <!-- 
            <input type="hidden" id="txtValEnd" name="txtValEnd" value="" />
            <input type="hidden" id="txtCtrlEnd" name="txtCtrlEnd" value="" />
            -->
            <div id="divCache"></div>
            <div id="ruleWrapTitle" style="font:Arial;font-weight:bold;color:#0066FF;margin-bottom:10px;">Approval Layers Editor</div>
            <div id="ruleWrapSubTitle" style="font:Arial;font-size:12px;color:Green;">
                This is layer must be filled in order to activate the newly created rule / scenario.<br />
                <strong>Note:</strong> Approval layers can be changed anytime in Approval Rules section (administrator access).
            </div>
            <div id="ruleWrapper">
                <div id="rule-wrapper"></div>
                <div id="btnBox" style="margin-top:30px; position:relative;">
                    <div id="btnAddLayer" class="btnSmall fl_left" title="Add Approval Layer">Add Layer</div>
                    <div id="btnUpdateLayer" class="btnSmall fl_right" title="Update Rule">Save Layers</div>
                    <div class="cl_both"></div>
                </div>
            </div>
        </div>
    </form>
</asp:Content>
